using System;
using System.Collections;
using UnityEngine;

public static class MonoBehaviourExtensions
{
	public static void DelayedRun(this MonoBehaviour mb, float delay, Action method)
	{
		mb.StartCoroutine(DelayedRunAsync(delay, method));
	}

	private static IEnumerator DelayedRunAsync(float delay, Action method)
	{
		yield return new WaitForSeconds(delay);
		method.Fire();
	}
}
